﻿using System;
using System.Drawing;
using System.ComponentModel;

using SBPweb.Modules.Communication;
using SBPweb.Modules.Modularity;

namespace SBPweb.MediaCenter.Modules.Organizer.WF
{

    public class Module : Organizer.Module
    {

        //private MenuItemControl tsi;

        public Module(IModuleHost parent)
            : base(parent)
        {
        }

        public override void Initialize()
        {
            base.Initialize();

            if (HostType != ModuleHostType.WindowsForms)
            {
                //TODO: log something
                return;
            }

        }

        public override void InitializeMenus()
        {
            //tsi = new MenuItemControl();
            //tsi.Name = "tsiTest";
            //tsi.Text = "Test message";
            //tsi.Size = new System.Drawing.Size(25, 20);
            //tsi.Click += new EventHandler(tsi_Click);
            //Host.Menu.Add(tsi);
        }

        public override void InitializeSmartparts()
        {
            //throw new NotImplementedException();
        }

        void tsi_Click(object sender, EventArgs e)
        {
            RequestObjectMessage<Bitmap> rom = new RequestObjectMessage<Bitmap>(this, "Faszom");
            rom.Respond += new EventHandler<RequestMessageEventArgs<Bitmap>>(rom_Respond);
            Host.Messages.Enqueue(rom);
        }

        void rom_Respond(object sender, RequestMessageEventArgs<Bitmap> e)
        {
            //tsi.Image = e.Message.Response;
        }


        public override void LoadPersistency()
        {
            throw new NotImplementedException();
        }

        public override void SavePersistency()
        {
            throw new NotImplementedException();
        }

        public override void Terminate()
        {
            throw new NotImplementedException();
        }
    }
}
